﻿@using VirtualPress.Infrastructure.Entities.Entity
@using VirtualPress.Tool.Framework
@{
    Periodical journal = ViewBag.Journal;
    ViewBag.Title = "稿件初审 —-" + journal.Name;
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
<div id="content-header">
    <h1>
        稿件初审</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/console/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="/workspace/console/article">
        最新稿件</a> <a href="javascript:" class="current">稿件初审</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-align-justify"></i></span>
                    <h5>
                        稿件初审</h5>
                </div>
                @{
                    Article article = ViewBag.Article;
                }
                <div class="widget-content nopadding">
                    <form class="form-horizontal" method="post" action="/workspace/console/NewManuscriptCheck">
                    <input type="hidden" name="id" value="@article.Id" />
                    <input type="hidden" name="journal" value="@Request.QueryString["journal"]" />
                    <div class="control-group">
                        <label class="control-label">
                            稿件标题:</label>
                        <div class="controls">
                            <label class="controls-label">
                                @article.Title</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            英文标题:</label>
                        <div class="controls">
                            <label class="controls-label">
                                @article.Title_EN</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            领域</label>
                        <div class="controls">
                            <label class="controls-label">@article.GJFW.Replace(";", "、 ")</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            作者:</label>
                        <div class="controls">
                            <label class="controls-label">
                                @{
                                    List<ArticleAuthor> list = ViewBag.Authors;
                                    for (int i = 0, len = list.Count; i < len; i++)
                                    {
                                    @Html.Raw(list[i].AuthorName)
                                        if (i != len - 1)
                                        {
                                    @Html.Raw("，")
                                        }
                                    }
                                }
                            </label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            摘要:</label>
                        <div class="controls">
                            <p style="width: 90%; line-height: 25px;">
                                @article.Abstract
                            </p>
                            <p style="width: 90%; line-height: 25px;">
                                @article.Abstract_EN
                            </p>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            关键词:</label>
                        <div class="controls">
                            <label class="controls-label">
                                @article.KeyWords @article.KeyWords_EN</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            稿件文件:</label>
                        <div class="controls">
                            <div class="controls-label">
                                <ul>
                                    @{
                                        List<Appendix> attachment = ViewBag.Attachment;
                                        if (attachment != null && attachment.Any())
                                        {
                                            foreach (var att in attachment)
                                            { 
                                        <li><a target="_blank" href="/download?token=@EncodeByBase64.Encode(new { id = att.Id, type = 9 }.ToJson())" title="下载稿件">
                                            <i class="icon-download"></i>
                                            @att.FileName;</a> <span style="color: #999; font-style: italic; padding-left: 25px;">@att.CreateTime.ToString("yyyy-MM-dd")</span>
                                        </li>
                                            }
                                        }
                                    }
                                </ul>
                            </div>
                        </div>
                    </div>
                     @if (ViewBag.Recommendation != null)
                     {
                        <div class="control-group">
                            <label class="control-label">
                                专家推荐材料</label>
                            <div class="controls">
                                <a target="_blank" title="点击下载" href="/download?token=@EncodeByBase64.Encode(new { id = ViewBag.Recommendation.Id, type = 9 }.ToJson())">
                                    <i class="icon-file icon-large"></i>
                                    @ViewBag.Recommendation.FileName;</a>
                            </div>
                        </div>
                        <div class="control-group">
                        <label class="control-label">
                            专审费用:</label>
                        <div class="controls" style="padding-top: 15px; color:Green;">
                            专家推荐，免除专审费
                        </div>
                    </div>
                     }
                     else
                     {
                    <div class="control-group">
                        <label class="control-label">
                            稿件页数:</label>
                        <div class="controls" style="padding-top: 5px;">
                            <input type="text" style="width:200px !important;" id="txtPage" name="Page" 
                                onblur="getprice(this)" value="@journal.ManuscriptPageSize" />
                            <span>@Html.Raw(journal.ManuscriptPageSize + "页以内￥：" + journal.PagePrice + "元，超过部分每页：" + journal.PricePerPrice + "元")</span>
                            <a href="/workspace/console/settings">修改计费规则</a>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            专审费用:</label>
                        <div class="controls" style="padding-top: 15px;">
                            人民币：<span id="spprice"></span>
                        </div>
                    </div>
                     }
                    <div class="control-group">
                        <label class="control-label">
                            初审意见:</label>
                        <div class="controls">
                            <label class="radio">
                                <input type="radio" name="optionsRadios" value="true" checked="checked" onclick="setsuggestion(this)" />
                                初审通过
                            </label>
                            <label class="radio">
                                <input type="radio" name="optionsRadios" value="false" onclick="setsuggestion(this)" />
                                拒绝
                            </label>
                        </div>
                    </div>
                    <div id="divrefuse" class="control-group" style="display: none;">
                        <label class="control-label">
                            拒绝理由:</label>
                        <div class="controls">
                            <textarea rows="3" cols="10" name="RefuseMessage"></textarea>
                        </div>
                    </div>
                    <div class="form-actions">
                        <a href="/workspace/console/article?group=0&journal=@Request.QueryString["journal"]" class="btn">
                            返 回</a>
                        <input type="submit" class="btn btn-primary" value="提 交" />
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript">
        var pricerole = @Html.Raw(new { defsize = journal.ManuscriptPageSize, defprice = journal.PagePrice, pageprice = journal.PricePerPrice }.ToJson());
        $(function () {
            $('#likarticle').addClass('open active');
            if($('#txtPage').length>0){
                getprice($('#txtPage'));
            }
        });
        function getprice(sender){
            var page = $(sender).val();
            if(!/^\d+$/.test(page)) {
                alert('稿件页数应为数字');
                $(sender).val(pricerole.defsize);
                $(sender).focus();
            }
            var num = parseInt(page,10);
            $('#spprice').text(pricerole.defsize - num >=0?pricerole.defprice:(num-pricerole.defsize) * pricerole.pageprice + pricerole.defprice);
        }
        function setsuggestion(sender){
            if($(sender).val() == 'true') {
               $('#divrefuse').hide();
            }
            else{
               $('#divrefuse').show();
            }
        }
    </script>
}
